home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / jpegview.zip / JVIEW.PCH < prev    next >
Text File  |  1992-04-16  |  24KB  |  704 lines

  1. diff -rc2N jpegsrc3/jconfig.h jviewsrc/jconfig.h
  2. *** jpegsrc3/jconfig.h    Sat Mar  7 21:26:04 1992
  3. --- jviewsrc/jconfig.h    Thu Apr 16 01:27:04 1992
  4. ***************
  5. *** 178,181 ****
  6. --- 178,182 ----
  7.   /* these defines indicate which image (non-JPEG) file formats are allowed */
  8.   #define GIF_SUPPORTED        /* GIF image file format */
  9. + #define VIEW_SUPPORTED      /* image viewer on screen  */
  10.   /* #define RLE_SUPPORTED */    /* RLE image file format (by default, no) */
  11.   #define PPM_SUPPORTED        /* PPM/PGM image file format */
  12. diff -rc2N jpegsrc3/jdmain.c jviewsrc/jdmain.c
  13. *** jpegsrc3/jdmain.c    Tue Mar 17 15:23:13 1992
  14. --- jviewsrc/jdmain.c    Thu Apr 16 01:27:04 1992
  15. ***************
  16. *** 70,74 ****
  17. --- 70,79 ----
  18.    */
  19.   
  20. + #ifdef VIEW_SUPPORTED
  21. +     unsigned char selmode;
  22. + #endif
  23.   typedef enum {
  24. +     FMT_VIEW,       /* view on screen */
  25.       FMT_GIF,        /* GIF format */
  26.       FMT_PPM,        /* PPM/PGM (PBMPLUS formats) */
  27. ***************
  28. *** 106,109 ****
  29. --- 111,119 ----
  30.      */
  31.     switch (requested_fmt) {
  32. + #ifdef VIEW_SUPPORTED
  33. +  case FMT_VIEW:
  34. +    jselview(cinfo);
  35. +    break;
  36. + #endif
  37.   #ifdef GIF_SUPPORTED
  38.     case FMT_GIF:
  39. ***************
  40. *** 159,163 ****
  41.   {
  42.     fprintf(stderr, "usage: %s ", progname);
  43. !   fprintf(stderr, "[-G] [-P] [-R] [-T] [-b] [-g] [-q colors] [-1] [-D] [-d] [-m mem]");
  44.   #ifdef TWO_FILE_COMMANDLINE
  45.     fprintf(stderr, " inputfile outputfile\n");
  46. --- 169,173 ----
  47.   {
  48.     fprintf(stderr, "usage: %s ", progname);
  49. !   fprintf(stderr, "[-v mode] [-G] [-P] [-R] [-T] [-b] [-g] [-q colors] [-1] [-D] [-d] [-m mem]");
  50.   #ifdef TWO_FILE_COMMANDLINE
  51.     fprintf(stderr, " inputfile outputfile\n");
  52. ***************
  53. *** 208,213 ****
  54.     /* Scan command line options, adjust parameters */
  55.     
  56. !   while ((c = egetopt(argc, argv, "GPRTbgq:1Dm:d")) != EOF)
  57.       switch (c) {
  58.       case 'G':            /* GIF output format. */
  59.         requested_fmt = FMT_GIF;
  60. --- 218,230 ----
  61.     /* Scan command line options, adjust parameters */
  62.     
  63. !   while ((c = egetopt(argc, argv, "v:1GPRTbgq:1Dm:d")) != EOF)
  64.       switch (c) {
  65. +     case 'v':            /* viewer output */
  66. +       if (optarg == NULL)
  67. +           usage(argv[0]);
  68. +       if (sscanf(optarg, "%d", &selmode) != 1)
  69. +           usage(argv[0]);
  70. +       requested_fmt =FMT_VIEW;
  71. +       break;
  72.       case 'G':            /* GIF output format. */
  73.         requested_fmt = FMT_GIF;
  74. ***************
  75. *** 276,281 ****
  76.   
  77.     if (optind != argc-2) {
  78. !     fprintf(stderr, "%s: must name one input and one output file\n", argv[0]);
  79. !     usage(argv[0]);
  80.     }
  81.     if ((cinfo.input_file = fopen(argv[optind], READ_BINARY)) == NULL) {
  82. --- 293,308 ----
  83.   
  84.     if (optind != argc-2) {
  85. !     if (requested_fmt == FMT_VIEW)
  86. !     {   if (optind != argc-1)
  87. !         {  
  88. !                         fprintf(stderr, "%s: must name one input file\n", argv[0]);
  89. !                     usage(argv[0]);
  90. !         }
  91. !     }
  92. !     else
  93. !     {
  94. !         fprintf(stderr, "%s: must name one input and one output file\n", argv[0]);
  95. !         usage(argv[0]);
  96. !     }
  97.     }
  98.     if ((cinfo.input_file = fopen(argv[optind], READ_BINARY)) == NULL) {
  99. ***************
  100. *** 283,290 ****
  101.       exit(EXIT_FAILURE);
  102.     }
  103. !   if ((cinfo.output_file = fopen(argv[optind+1], WRITE_BINARY)) == NULL) {
  104. !     fprintf(stderr, "%s: can't open %s\n", argv[0], argv[optind+1]);
  105. !     exit(EXIT_FAILURE);
  106. !   }
  107.   
  108.   #else /* not TWO_FILE_COMMANDLINE -- use Unix style */
  109. --- 310,321 ----
  110.       exit(EXIT_FAILURE);
  111.     }
  112. !   if (requested_fmt != FMT_VIEW)
  113. !   {
  114. !         if ((cinfo.output_file = fopen(argv[optind+1], WRITE_BINARY)) == NULL) {
  115. !         fprintf(stderr, "%s: can't open %s\n", argv[0], argv[optind+1]);
  116. !         exit(EXIT_FAILURE);
  117. !         }
  118. !   } 
  119.   
  120.   #else /* not TWO_FILE_COMMANDLINE -- use Unix style */
  121. diff -rc2N jpegsrc3/jview.c jviewsrc/jview.c
  122. *** jpegsrc3/jview.c
  123. --- jviewsrc/jview.c    Thu Apr 16 01:27:04 1992
  124. ***************
  125. *** 0 ****
  126. --- 1,354 ----
  127. + /*
  128. +  * jview.c
  129. +  *
  130. +  * JPEG VGA-viewer V 1.0
  131. +  * Copyright (C) 1992, by Hubertus Kehl
  132. +  * This file is not part of the Independent JPEG Group's software.
  133. +  * 
  134. +  * For conditions of distribution and use, see the accompanying README file,
  135. +  * and the README.VIW file. 
  136. +  *
  137. +  * This file contains routines to write output images to screen.
  138. +  *
  139. +  * These routines may need modification for non TSENG 3000 VGA-cards.
  140. +  * PERMISSION TO USE this software is only granted, if you use it at your own
  141. +  * risk. That means especially trying on non TSENG 3000 cards and trying
  142. +  * on monitors and cards that don't support the hires modes.
  143. +  * No warranty at all for implied defects of your hard- and software. 
  144. +  * Read README.VIW first.
  145. +  * Send bugs, patches, additional config files etc. to 
  146. +  * kehl@informatik.tu-muenchen.de
  147. +  *
  148. +  * These routines are invoked via the methods put_pixel_rows, put_color_map,
  149. +  * and output_init/term.
  150. +  *
  151. +  * Modified from jwrgif contributed by  Thomas G. Lane.
  152. +  * but there isn't any GIF-stuff in here any more
  153. +  */
  154. + /* from jwrgif ....
  155. +  * This code is loosely based on ppmtogif from the PBMPLUS distribution
  156. +  * of Feb. 1991.  That file contains the following copyright notice:
  157. +  *    Based on GIFENCODE by David Rowley <mgardi@watdscu.waterloo.edu>.
  158. +  *    Lempel-Ziv compression based on "compress" by Spencer W. Thomas et al.
  159. +  *    Copyright (C) 1989 by Jef Poskanzer.
  160. +  *    Permission to use, copy, modify, and distribute this software and its
  161. +  *    documentation for any purpose and without fee is hereby granted, provided
  162. +  *    that the above copyright notice appear in all copies and that both that
  163. +  *    copyright notice and this permission notice appear in supporting
  164. +  *    documentation.  This software is provided "as is" without express or
  165. +  *    implied warranty.
  166. +  *
  167. +  * We are also required to state that
  168. +  *    "The Graphics Interchange Format(c) is the Copyright property of
  169. +  *    CompuServe Incorporated. GIF(sm) is a Service Mark property of
  170. +  *    CompuServe Incorporated."
  171. +  */
  172. + #include "jinclude.h"
  173. + #include <conio.h>
  174. + #include <mem.h>
  175. + #include <dos.h>
  176. + #ifdef VIEW_SUPPORTED
  177. + struct Vmode
  178. + {   unsigned int modeax;
  179. +     unsigned int modebx;
  180. +     unsigned int xres;
  181. +     unsigned int yres;
  182. + } Vmodes[10];
  183. + extern unsigned char selmode;
  184. + static decompress_info_ptr dcinfo; /* to avoid passing to all functions */
  185. + unsigned char palette[257][3];
  186. + unsigned int grow;
  187. + unsigned int maxwidth,maxrow,width;
  188. + void far setpal(unsigned char far *pal)
  189. + {
  190. + unsigned numcol;      
  191. + numcol=256;
  192. + asm {
  193. +         mov ax,1012h    /* set EGA palette registers (block) */
  194. +         sub bx,bx       /* no. of the startregister == 0 */
  195. +         mov cx,numcol   /* no. of the colorregisters  */
  196. +         /* pointer to the colorpalette in RGB format (3 bytes per entry) */
  197. +         les dx,pal      /* Segment to ES, Offset to DX   */
  198. +         int 10h
  199. +     }
  200. + }
  201. + void setvideomode(unsigned int modeax,unsigned int modebx)
  202. + {
  203. +     _AX=modeax;
  204. +     _BX=modebx;
  205. +     geninterrupt(0x10);
  206. + }
  207. + LOCAL void
  208. + emit_header (int num_colors, JSAMPARRAY colormap)
  209. + /* set the palette according to the params  */
  210. + /* If colormap==NULL, synthesize a gray-scale colormap */
  211. + {
  212. +   int BitsPerPixel, ColorMapSize, FlagByte;
  213. +   int cshift = dcinfo->data_precision - 6;
  214. +   int i;
  215. +   unsigned int val;
  216. +   unsigned char bt;
  217. +  
  218. +   /* set the video mode */
  219. +   setvideomode(Vmodes[selmode].modeax,Vmodes[selmode].modebx);
  220. +   if (num_colors > 256)
  221. +     ERREXIT(dcinfo->emethods, "Viewer can only handle 256 colors");
  222. +   /* Compute bits/pixel and related values */
  223. +   BitsPerPixel = 1;
  224. +   while (num_colors > (1 << BitsPerPixel))
  225. +     BitsPerPixel++;
  226. +   ColorMapSize = 1 << BitsPerPixel;
  227. +   /* Set the Global Color Map */
  228. +   /* If the color map is more than 8 bits precision, */
  229. +   /* we reduce it to 8 bits by shifting */
  230. +   for (i=0; i < ColorMapSize; i++) {
  231. +     if (i < num_colors) {
  232. +       if (colormap != NULL) {
  233. +     if (dcinfo->out_color_space == CS_RGB) {
  234. +       /* Normal case: RGB color map */
  235. +       palette[i][0]=GETJSAMPLE(colormap[0][i]) >> cshift;
  236. +       palette[i][1]=GETJSAMPLE(colormap[1][i]) >> cshift;
  237. +       palette[i][2]=GETJSAMPLE(colormap[2][i]) >> cshift;
  238. +     } else {
  239. +       /* Grayscale "color map": possible if quantizing grayscale image */
  240. +       bt=GETJSAMPLE(colormap[0][i]) >> cshift;
  241. +       palette[i][0]=bt;
  242. +       palette[i][1]=bt;
  243. +       palette[i][2]=bt;
  244. +     }
  245. +       } else {
  246. +     /* Create a gray-scale map of num_colors values, range 0..255 */
  247. +       val=(i * 255 + (num_colors-1)/2) / (num_colors-1);
  248. +       bt=val;
  249. +       bt >>= 2;
  250. +       palette[i][0]=bt;
  251. +       palette[i][1]=bt;
  252. +       palette[i][2]=bt;
  253. +       }
  254. +     }
  255. +   }
  256. +   setpal((unsigned char far *) &palette[0][0]);
  257. + }
  258. + /*
  259. +  * Initialize for output on screen.
  260. +  */
  261. + METHODDEF void
  262. + output_init (decompress_info_ptr cinfo)
  263. + {
  264. +     unsigned char i,argu;
  265. +     char ch;
  266. +     FILE *stream;
  267. +    dcinfo = cinfo;      /* save for use by local routines */
  268. +  
  269. +     for(i=0;i<=9;i++)
  270. +     {   Vmodes[i].modeax=0x13;
  271. +         Vmodes[i].modebx=0x00;
  272. +         Vmodes[i].xres=320;
  273. +         Vmodes[i].yres=200;
  274. +     }
  275. +     if (selmode > 9)
  276. +         ERREXIT(cinfo->emethods, "wrong modenr: only 9 modes supported");
  277. +    /* open config file */
  278. +     if ((stream = fopen("vgamode.cfg", "r"))
  279. +         == NULL)
  280. +     {
  281. +         ERREXIT(cinfo->emethods, "could not open vgamode.cfg");
  282. +     }
  283. +     argu=1;
  284. +     i=1;
  285. +     do
  286. +     {
  287. +         /* read chars until EOF or # found */
  288. +         ch = fgetc(stream);
  289. +         if (ch=='#')
  290. +             switch (argu)
  291. +             {   case 1:     if (i > 9)
  292. +                             ERREXIT(cinfo->emethods, "vgamode.cfg: "
  293. +                             "too much videomodes described (>9).");
  294. +                             fscanf(stream,"%x#",&(Vmodes[i].modeax));
  295. +                             argu++;
  296. +                             break;
  297. +                 case 2:     fscanf(stream,"%x#",&(Vmodes[i].modebx));
  298. +                             argu++;
  299. +                             break;
  300. +                 case 3:     fscanf(stream,"%u#",&(Vmodes[i].xres));
  301. +                             argu++;
  302. +                             break;
  303. +                 case 4:     fscanf(stream,"%u#",&(Vmodes[i].yres));
  304. +                             argu=1;i++;
  305. +                             break;
  306. +             }
  307. +    } while (ch != EOF);
  308. +    fclose(stream);
  309. +  /*
  310. +    * If we aren't quantizing, put_color_map won't be called,
  311. +    * so emit the header now.  This only happens with gray scale output.
  312. +    * (If we are quantizing, wait for the color map to be provided.)
  313. +    */
  314. +    if (! cinfo->quantize_colors)
  315. +      emit_header(256, (JSAMPARRAY) NULL);
  316. +    else
  317. +      printf("Quantizing color map...      please wait\n");
  318. +     maxwidth=Vmodes[selmode].xres;
  319. +     maxrow=Vmodes[selmode].yres;
  320. +    width= cinfo->image_width;
  321. +    /* is row longer as row of selected mode */
  322. +    if (width > maxwidth) width=maxwidth;   
  323. +    /* start in first row */
  324. +    grow=0;
  325. + }
  326. + /*
  327. +  * Write the color map.
  328. +  */
  329. + METHODDEF void
  330. + put_color_map (decompress_info_ptr cinfo, int num_colors, JSAMPARRAY colormap)
  331. + {
  332. +   emit_header(num_colors, colormap);
  333. + }
  334. + void putrow(int y, unsigned char far *bitmap,unsigned int size)
  335. + {
  336. +     unsigned int offset,seg;
  337. +     unsigned char page;
  338. +     unsigned int fsize;
  339. +     
  340. + asm {   push ax  /* save regs */
  341. +         push dx
  342. +         push bx
  343. +         mov bx,y
  344. +         mov ax,maxwidth   /* max xres of current video mode */
  345. +         mul bx          /* calculate offset in video mem */
  346. +         add ax,0h       /* xpos =0 */
  347. +         adc dx,0000
  348. +         mov offset,ax
  349. +         mov al,dl
  350. +         or al,40h       /* select page for desired row */
  351. +         mov page,al
  352. +         mov dx,03CDh
  353. +         out dx,al
  354. +         pop bx          /* restore regs */
  355. +         pop dx
  356. +         pop ax
  357. +     }
  358. +     /* check if row goes over page border */
  359. +     if (((long) offset+size)<0x10000L)
  360. +     {   seg=0xA000;
  361. +         /* move row to video mem */
  362. +         movedata(FP_SEG(bitmap),FP_OFF(bitmap),seg,offset,size);
  363. +     }
  364. +     else
  365. +     {   /* Writing row over page border */
  366. +         fsize=(unsigned int) (0x10000L-offset);
  367. +         seg=0xA000;
  368. +         /* move first part of row to video mem */
  369. +         movedata(FP_SEG(bitmap),FP_OFF(bitmap),seg,offset,fsize);
  370. +         /* select next page */
  371. +         page++;
  372. +         outportb(0x3CD,page);
  373. +         /* move second part of row to video mem */
  374. +         movedata(FP_SEG((bitmap+fsize)),FP_OFF((bitmap+fsize)),
  375. +                 seg,0,size-fsize);
  376. +     }
  377. + }
  378. + /*
  379. +  * Write some pixel data.
  380. +  */
  381. + METHODDEF void
  382. + put_pixel_rows (decompress_info_ptr cinfo, int num_rows,
  383. +         JSAMPIMAGE pixel_data)
  384. + {
  385. +     unsigned int row;
  386. +                         
  387. +     for (row = 0; row < num_rows; row++)
  388. +     {
  389. +     /* are there more rows as on screen ? */
  390. +     if ((grow+row) < maxrow)
  391. +         putrow(row+grow,&pixel_data[0][row][0],width);   
  392. +     }
  393. +     grow=grow+row;
  394. + }
  395. + /*
  396. +  * Wait for end of viewing
  397. +  */
  398. + METHODDEF void
  399. + output_term (decompress_info_ptr cinfo)
  400. + {
  401. +     /* wait for end of viewing, restore crt */
  402. +     getch();
  403. +     setvideomode(0x03,0x00);
  404. + }
  405. + /*
  406. +  * The method selection routine for the viewer.
  407. +  * This should be called from d_ui_method_selection if viewer output is wanted.
  408. +  */
  409. + GLOBAL void
  410. + jselview (decompress_info_ptr cinfo)
  411. + {
  412. +   cinfo->methods->output_init = output_init;
  413. +   cinfo->methods->put_color_map = put_color_map;
  414. +   cinfo->methods->put_pixel_rows = put_pixel_rows;
  415. +   cinfo->methods->output_term = output_term;
  416. +   if (cinfo->out_color_space != CS_GRAYSCALE &&
  417. +       cinfo->out_color_space != CS_RGB)
  418. +     ERREXIT(cinfo->emethods, "Viewer output must be grayscale or RGB");
  419. +   /* Force quantization if color or if > 8 bits input */
  420. +   if (cinfo->out_color_space == CS_RGB || cinfo->data_precision > 8) {
  421. +     /* Force quantization to at most 256 colors */
  422. +     cinfo->quantize_colors = TRUE;
  423. +     if (cinfo->desired_number_of_colors > 256)
  424. +       cinfo->desired_number_of_colors = 256;
  425. +   }
  426. + }
  427. + #endif /* VIEW_SUPPORTED */
  428. diff -rc2N jpegsrc3/makdjpeg.lst jviewsrc/makdjpeg.lst
  429. *** jpegsrc3/makdjpeg.lst    Tue Mar 17 15:24:47 1992
  430. --- jviewsrc/makdjpeg.lst    Thu Apr 16 01:27:04 1992
  431. ***************
  432. *** 2,4 ****
  433.   jdhuff.obj jdmcu.obj jdpipe.obj jdsample.obj jquant1.obj jquant2.obj
  434.   jrevdct.obj jrdjfif.obj jwrgif.obj jwrppm.obj jwrrle.obj jwrtarga.obj
  435. ! jutils.obj jerror.obj jmemmgr.obj jmemsys.obj jmemdosa.obj
  436. --- 2,5 ----
  437.   jdhuff.obj jdmcu.obj jdpipe.obj jdsample.obj jquant1.obj jquant2.obj
  438.   jrevdct.obj jrdjfif.obj jwrgif.obj jwrppm.obj jwrrle.obj jwrtarga.obj
  439. ! jutils.obj jerror.obj jmemmgr.obj jmemsys.obj jmemdosa.obj jview.obj
  440. ! graphics.lib emu.lib
  441. \ No newline at end of file
  442. diff -rc2N jpegsrc3/makefile.bcc jviewsrc/makefile.bcc
  443. *** jpegsrc3/makefile.bcc    Tue Mar 17 15:24:45 1992
  444. --- jviewsrc/makefile.bcc    Thu Apr 16 01:27:04 1992
  445. ***************
  446. *** 12,20 ****
  447.   
  448.   # The name of your C compiler:
  449. ! CC= bcc
  450.   
  451.   # You may need to adjust these cc options:
  452. ! CFLAGS= -DHAVE_STDC -DINCLUDES_ARE_ANSI \
  453. !     -ms -DMSDOS -DINCOMPLETE_TYPES_BROKEN -w-par -O2
  454.   # -DHAVE_STDC -DINCLUDES_ARE_ANSI enable ANSI-C features (we DON'T want -A)
  455.   # -ms selects small memory model for most efficient code
  456. --- 12,20 ----
  457.   
  458.   # The name of your C compiler:
  459. ! CC= tcc
  460.   
  461.   # You may need to adjust these cc options:
  462. ! CFLAGS= -DHAVE_STDC -DINCLUDES_ARE_ANSI -ms -DMSDOS -O -G -Z\
  463. !  -DINCOMPLETE_TYPES_BROKEN -w-par 
  464.   # -DHAVE_STDC -DINCLUDES_ARE_ANSI enable ANSI-C features (we DON'T want -A)
  465.   # -ms selects small memory model for most efficient code
  466. ***************
  467. *** 35,39 ****
  468.           jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  469.           jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  470. !         jwrppm.c jwrrle.c jwrtarga.c
  471.   # virtual source files (not present in distribution file)
  472.   VIRTSOURCES= jmemsys.c
  473. --- 35,39 ----
  474.           jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  475.           jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  476. !         jwrppm.c jwrrle.c jwrtarga.c jview.c
  477.   # virtual source files (not present in distribution file)
  478.   VIRTSOURCES= jmemsys.c
  479. ***************
  480. *** 64,68 ****
  481.           jdhuff.obj jdmcu.obj jdpipe.obj jdsample.obj jquant1.obj \
  482.           jquant2.obj jrevdct.obj jrdjfif.obj jwrgif.obj jwrppm.obj \
  483. !         jwrrle.obj jwrtarga.obj
  484.   DOBJECTS= jdmain.obj $(DLIBOBJECTS) $(COMOBJECTS)
  485.   # These objectfiles are included in libjpeg.lib
  486. --- 64,68 ----
  487.           jdhuff.obj jdmcu.obj jdpipe.obj jdsample.obj jquant1.obj \
  488.           jquant2.obj jrevdct.obj jrdjfif.obj jwrgif.obj jwrppm.obj \
  489. !         jwrrle.obj jwrtarga.obj jview.obj
  490.   DOBJECTS= jdmain.obj $(DLIBOBJECTS) $(COMOBJECTS)
  491.   # These objectfiles are included in libjpeg.lib
  492. ***************
  493. *** 132,135 ****
  494. --- 132,136 ----
  495.   jwrjfif.obj : jwrjfif.c jinclude.h jconfig.h jpegdata.h
  496.   jwrgif.obj : jwrgif.c jinclude.h jconfig.h jpegdata.h
  497. + jview.obj : jview.c jinclude.h jconfig.h jpegdata.h
  498.   jwrppm.obj : jwrppm.c jinclude.h jconfig.h jpegdata.h
  499.   jwrrle.obj : jwrrle.c jinclude.h jconfig.h jpegdata.h
  500. diff -rc2N jpegsrc3/readme.viw jviewsrc/readme.viw
  501. *** jpegsrc3/readme.viw
  502. --- jviewsrc/readme.viw    Thu Apr 16 01:27:04 1992
  503. ***************
  504. *** 0 ****
  505. --- 1,67 ----
  506. + README for the viewer version 1.0 (C) 4/1992 by Hubertus Kehl
  507. + =============================================================
  508. + This distribution is an additional source based on the JPEG sources of the 
  509. + Independent JPEG Group. An viewer for VGA-cards has been implemented (jview)
  510. + and some changes in jdmain have been made, to implement a new switch -v mode
  511. + for the viewer. For details about the JPEG sources read README and USAGE.
  512. + This file describes only the things about the viewer source. Conditions for the
  513. + viewer are nearly the same as the Independent JPEG Group states for their
  514. + sources.
  515. + You are welcome to redistribute this software and to use it for any purpose,
  516. + subject to the conditions under LEGAL ISSUES, below.
  517. + DISCLAIMER
  518. + ==========
  519. + THIS SOFTWARE IS NOT COMPLETE NOR FULLY DEBUGGED.  It is not guaranteed to be
  520. + useful for anything. (See LEGAL ISSUES for even more disclaimers.)
  521. + Please report any problems with this software to kehl@informatik.tu-muenchen.de
  522. + LEGAL ISSUES
  523. + ============
  524. + The author makes NO WARRANTY or representation, either express or implied,
  525. + with respect to this software, its quality, accuracy, merchantability, or
  526. + fitness for a particular purpose.  This software is provided "AS IS", and you,
  527. + its user, assume the entire risk as to its quality and accuracy.
  528. + This software is copyright (C) 1992, Hubertus Kehl.
  529. + All Rights Reserved except as specified below.
  530. + Permission is hereby granted to use, copy, modify, and distribute this
  531. + software (or portions thereof) for any purpose, without fee, subject to these
  532. + conditions:
  533. + (1) If any part of the source code for this software is distributed, then this
  534. + README files must be included, with this copyright and no-warranty notice
  535. + unaltered; and any additions, deletions, or changes to the original files
  536. + must be clearly indicated in accompanying documentation.
  537. + (2) Permission for use of this software is granted only if the user accepts
  538. + full responsibility for any undesirable consequences; the author accepts
  539. + NO LIABILITY for damages of any kind.
  540. + Permission is NOT granted for the use of any author's name or author's company
  541. + name in advertising or publicity relating to this software or products derived
  542. + from it.
  543. + I specifically permit and encourage the use of this software as the basis of
  544. + commercial products, provided that all warranty or liability claims are
  545. + assumed by the product vendor.
  546. + CHANGES
  547. + =======
  548. + The following changes/additions to the jpegsrc.v3 of the Independent JPEG Group
  549. + have been made:
  550. + makdjpeg.lst       added jview.obj for linker
  551. + makefile.bcc       added generation and dependencies of jview.obj
  552. + jconfig.h          defined compiler switch VIEW_SUPPORTED
  553. + jdmain.c           Added option -v [mode] and checks for this
  554. + jview.c            The viewer itself
  555. + vgamode.cfg        configuration file for the VGA modes
  556. + README.VIW         the viewer readme
  557. + USAGE.VIW          the viewer usage
  558. diff -rc2N jpegsrc3/usage.viw jviewsrc/usage.viw
  559. *** jpegsrc3/usage.viw
  560. --- jviewsrc/usage.viw    Thu Apr 16 01:27:04 1992
  561. ***************
  562. *** 0 ****
  563. --- 1,54 ----
  564. + USAGE instructions for the VGA viewer
  565. + =====================================
  566. + (C) 4/1992 by Hubertus Kehl
  567. + INTRODUCTION
  568. + This distribution is an additional source based on the JPEG sources of the 
  569. + Independent JPEG Group. An viewer for VGA-cards has been implemented (jview)
  570. + and some changes in jdmain have been made, to implement a new switch -v mode
  571. + for the viewer.
  572. + You can reconstruct my changes on the jpegsrc.v3 if you patch the
  573. + diff-file over these sources.
  574. + I don't distribute sources of Independent JPEG Group only my changes on it.
  575. + Permission for use of this software is only granted, if you use it at
  576. + your own risk. No warranty at all for damaged soft and hardware (monitors
  577. + tortured with wrong hires modes etc.)
  578. + (see also README.VIW and README)
  579. + This software has only been tested on a TSENG 3000 card. A file to configure
  580. + the videomodes has been provided. But if this helps to get the viewer work on 
  581. + your card, i don't know. Some changes may be necessary in jview.c (setvideomode
  582. +  or putrow etc.) The viewer can only be compiled with TURBO C or Borland C
  583. + because it makes heavy use of the compiler's inline assembler and memory lib
  584. + functions. Use Makefile.bcc for this.
  585. + The viewer itself is very fast. The viewer takes only about 1% of the whole
  586. + run-time of program. (Measured with a profiler). On a "normal" color image
  587. + the quantization takes about 40-50 % and the decompression the rest. For faster
  588. + viewing try -g or -1 to avoid the good looking, but slow 2-pass quantization.
  589. + GENERAL USAGE
  590. +     djpeg [switches] jpegfile  imagefile
  591. +     and for the viewer:
  592. +     
  593. +     djpeg [switches] jpegfile  
  594. + DJPEG DETAILS
  595. + A parameter for the viewer has been added:
  596. +     -v mode    Output a jpeg file to screen using the given videomode.
  597. +             Mode corresponds to the videomodes defined in the vgamode.cfg file.
  598. +             The first entry there, is mode 1. Viewing has only been tested
  599. +             on a TSENG 3000, for over cards you may need some modification in
  600. +             the sources in setvideomode, putrow or setpal.
  601. +             All options of djpeg are supported. Most times you can use -g 
  602. +             (grayscale) for faster viewing, because of avoiding color
  603. +             quantization.
  604. +             (viewing implies -q, with default of 256 colors).
  605. +             You have only to specify one inputfile and no outputfile.
  606. + Send bugs, patches, additional config files etc. to 
  607. + kehl@informatik.tu-muenchen.de
  608. diff -rc2N jpegsrc3/vgamode.cfg jviewsrc/vgamode.cfg
  609. *** jpegsrc3/vgamode.cfg
  610. --- jviewsrc/vgamode.cfg    Thu Apr 16 01:35:05 1992
  611. ***************
  612. *** 0 ****
  613. --- 1,10 ----
  614. + VGA-videomode config file
  615. + for TSENG 3000 cards
  616. + Be careful with editing this file !!!
  617. + setvideomode with int 10:
  618. + AX           BX            resolution X     resolution Y
  619. + #0x13#       #0x00#        #320#            #200#
  620. + #0x2D#       #0x00#        #640#            #350#
  621. + #0x2E#       #0x00#        #640#            #480#
  622. + #0x30#       #0x00#        #800#            #600#
  623.